package com.durian.financial.api.domain.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

/**
 * @Author zhouzhiyi
 * @Date 2022/6/25 16:01
 * @Description 资金提供方枚举
 */
@Getter
public enum CompanyEnum {

    UNDEFINED(-1L,"未定义"),JIU_JIN_SUO(1L,"久金所"),YING_HUA(2L,"应花");

    @EnumValue
    @JsonValue
    private final Long index;

    private final String value;

    CompanyEnum(Long index, String value) {
        this.index = index;
        this.value = value;
    }

    /**
     * 获取资金提供方Map
     * @return Map<Long,String>
     */
    public static Map<Long,String> getCompanyEnumMap(){

        HashMap<Long, String> map = new HashMap<>();

        for (CompanyEnum temp : EnumSet.allOf(CompanyEnum.class)) {

            map.put(temp.index,temp.value);
        }

        return map;
    }


}
